var infowindow1;
var map1;
function initializeDestMap() {
	    var myLatlng = new google.maps.LatLng(57.7001953125, 11.93115234375);
	    var myOptions = {
	      zoom: 10,
	      center: myLatlng,
	      mapTypeId: google.maps.MapTypeId.ROADMAP
	    }
	    
	    map1 = new google.maps.Map(document.getElementById("map_canvasDest"), myOptions);
	    downloadUrl("js/finalDestination.xml", function(data) {
	    	//"js/moredata.xml"  "js/Location.xml"
	    
	      var markers = data.documentElement.getElementsByTagName("marker");
	      for (var i = 0; i < markers.length; i++) {
	        var latlng = new google.maps.LatLng(parseFloat(markers[i].getAttribute("lat")),
	                                    parseFloat(markers[i].getAttribute("lng")));
	        var marker = createMarkerDest(markers[i].getAttribute("name"), latlng);
	       }
	     });
	  }
  function createMarkerDest(name, latlng) {
	    var marker = new google.maps.Marker({position: latlng, map: map1});
	    google.maps.event.addListener(marker, "click", function() {
	      if (infowindow1) infowindow.close();
	      infowindow1 = new google.maps.InfoWindow({content: name});
	      infowindow1.open(map1, marker);
	    });
	   
	    if(name =="BUS"){
	    	iconFile = 'images/black.png'; 
	    }
	    else if(name =="CAR"){
	    	iconFile = 'images/red.png'; 
	    }
	    else if(name =="BICYCLE"){
	    	iconFile = 'images/green.png'; 
	    }
	    else if(name =="WALKING"){
	    	iconFile = 'images/yellow.png'; 
	    }
	    else if(name =="FERRY"){
	    	iconFile = 'images/blue.png'; 
	    }
	    else if(name =="TRAIN_SUBWAY_METRO"){
	    	iconFile = 'images/pink.png'; 
	    }
	    else if(name =="AEROPLANE"){
	    	iconFile = 'images/silver.png'; 
	    }
	    marker.setIcon(iconFile) ;
	    return marker;
	  }